<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <#include "/pubHeadStyle.html">
</head>
<body>
<title>短信邮件模板选择框</title>
<div class="ccpui-tablesize" style="padding:10px;">
    <table id="noteTemplate" lay-filter="noteTemplate"></table>
</div>
<script id="htmlContent" type="text/html">
    <i class="layui-icon layui-icon-edit" onclick="select(this)"></i>
    <span>{{ d.htmlContent }}</span>
</script>
<script id="plainContent" type="text/html">
    <i class="layui-icon layui-icon-edit" onclick="select(this)"></i>
    <span>{{ d.plainContent }}</span>
</script>

<script>
    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index','table','jquery', 'setter','totalFilter','commons'],function () {
        var table = layui.table, setter = layui.setter,
            totalFilter = layui.totalFilter,commons = layui.commons,$=layui.$;

        var tableH = commons.tabHeight();
        //渲染表格
        table.render({
            elem: '#noteTemplate'
            , cellMinWidth: 80
            , title: '模板管理列表'
            , defaultToolbar: []
            , height: tableH
            , url: serverPath.workflowPath + setter.workflowLinkPath + 'sysTemplate/list'
            , page: true
            , autoSort: false
            , cols: [[
                {field: 'name', title: '模板名称',align: 'center',width:150}
                , {field: 'useType', title: '模板用途', align: 'center',width:150,
                    templet: function (d) {
                        var useType = d.useType;
                        switch (useType) {
                            case 1:
                                return "终止提醒";
                            case 2:
                                return "催办提醒";
                            case 3:
                                return "审批提醒";
                            case 4:
                                return "撤销提醒";
                            case 5:
                                return "取消转办";
                            case 6:
                                return "沟通提醒";
                            case 7:
                                return "归档提醒";
                            case 8:
                                return "转办提醒";
                            case 9:
                                return "退回提醒";
                            case 10:
                                return "沟通反馈";
                            case 11:
                                return "取消代理";
                            case 12:
                                return "抄送提醒";
                            case 13:
                                return "流程节点无人员";
                            case 14:
                                return "跟进事项预警";
                            case 15:
                                return "跟进事项到期";
                            case 16:
                                return "跟进事项完成";
                            case 17:
                                return "跟进事项通知";
                            case 18:
                                return "跟进事项已评价知会";
                            case 19:
                                return "逾期提醒";
                            case 22:
                                return "代理提醒";
                            case 23:
                                return "消息转发";
                            case 24:
                                return "重启任务";
                            case 25:
                                return "通知任务所属人（代理）";
                            case 26:
                                return "加签提醒";
                            case 27:
                                return "加签反馈";
                            case 28:
                                return "取消流转";
                            case 29:
                                return "补签提醒";
                            case 30:
                                return "创建人消息提醒";
                        }
                    }
                }
                , {field: 'htmlContent', title: 'html富文本', align: 'left',templet: '#htmlContent'}
                , {field: 'plainContent', title: '普通文本', align: 'left',templet: '#plainContent'}
            ]]
            ,done:function () {
            }
        });
        totalFilter.init('noteTemplate');


        select=function(obj){
            var span = $(obj).siblings('span');
            layui.templateHtml = span.html();
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        }
    });
</script>

<style>
    #selector .layui-icon{
        font-size: 14px;
    }
</style>
</body>
</html>